Shared-memory parallel programs in which threads executed in parallel share data are often used by multicore processors. One method used to prevent access conflicts is HTM. HTM is transactional memory implemented as hardware.
In HTM, each executed thread has a local copy, and the results of processing on the local copy are written conditionally when, at the end of processing, a shared resource value is not written by another thread. This processing is called a commit. The process itself is dropped when a shared resource value is written by another thread. Transactions are sometimes cancelled (aborted). When an abort occurs, any changes to a shared resource by the transaction are cancelled (rolled back). A transaction is a series of atomic processes executed by a single thread.
Commercial machines incorporating HTM have recently appeared on the market. HTM is used in a managed runtime environment such as a Java (registered trademark) virtual machine (VM) to optimize various items and operations, such as lock elision, partial inlining, speculative check elimination, and HTM-based concurrent libraries. A managed runtime environment relies on various runtime helpers such as JIT compilers and memory allocators. Here, runtime helpers are functions of virtual machines called by an interpreter or JIT-compiled executable code during runtime but are not included in the interpreter or JIT-compiled executable code. However, some runtime helpers cause an abort when called and run while a transaction is being executed.
Prior art techniques used to address aborts can be found in Patent Literature 1-3 and Non-patent Literature 1-3. Patent Literature 1 and Non-patent Literature 2 describe techniques in which an appropriate action is taken in the abort handler in response to abort information provided by the HTM hardware. Patent Literature 2 describes a technique in which a transaction is temporarily suspended while the transaction is being executed, some processing is performed, and the transaction is then restarted. Patent Document 3 describes a technique in which the implementation of a plurality of transactional memories is switched during runtime.
Non-patent Literature 1 describes a technique in which a non-transactional path is run after a transaction has been aborted and several retries attempted, followed by re-execution of the transaction. Non-patent Literature 3 describes delayed re-execution of transactions after an abort has occurred because of a conflict between transactions.